package com.example.administrator.familfinalcialmanagement.util.dialog;

import android.content.Context;
import android.databinding.DataBindingUtil;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;

import com.example.administrator.familfinalcialmanagement.R;
import com.example.administrator.familfinalcialmanagement.databinding.MyDialogBinding;
import com.example.administrator.familfinalcialmanagement.util.ToastUtil;
import com.example.administrator.familfinalcialmanagement.util.listener.OnGRClickListener;


public class MyDialog extends BaseDialog {

    Context context;
    MyDialogBinding inComminBinding;
    OnGRClickListener onGRClickListener;
    String money;

    public MyDialog(Context context) {
        super(context);
        this.context = context;
        inComminBinding = DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.my_dialog, null, false);
        inComminBinding.setDialog(this);
        setContentView(inComminBinding.getRoot());
    }

    public void setOnGRClickListener(OnGRClickListener listener) {
        this.onGRClickListener = listener;
    }

    public void noPoint(View view) {
        if (onGRClickListener != null) {
            onGRClickListener.setOnCloseClick();
        }
        dismiss();
    }

    public void okPoint(View view) {

        String money = inComminBinding.etModuleMoney.getText().toString().trim();
        if (TextUtils.isEmpty(money)) {
            ToastUtil.showToast("请输入金额");
            return;
        }

        if (onGRClickListener != null) {
            onGRClickListener.setOnConfirmClick(money);
        }
        dismiss();
    }

}

